<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <%
        pageContext.setAttribute("APP_PATH", request.getContextPath());
    %>
    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
    <title>教师</title>
</head>

<jsp:include page="teacher_header.jsp"/>
<div class="container" style="height: 100%">

    <form class="form-horizontal" id="add">
        <div class="form-group">
            <label class="col-sm-2 control-label">教师id</label>
            <div class="col-sm-10">
                <input type="text" value="${id_infor}" style="disabled:disabled;" class="form-control" id="adminId">
            </div>

        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">新的教师密码</label>
            <div class="col-sm-10">
                <input type="password" name="password" class="form-control" id="adminPassword">
            </div>
        </div>


    </form>
    <div class="col-md-4 col-md-offset-5">
        <button class="btn btn-primary btn-lg " id="clear-btn" type="reset">重置</button>
        <button class="btn btn-success btn-lg " id="sub-btn">提交</button>
    </div>
</div>


<script type="text/javascript">
    $("#clear-btn").click(function () {
        window.location.replace("./tea_change_pas.jsp");
    });

    $("#sub-btn").click(function () {
        $.ajax({
            url: "${APP_PATH}/updatePassword",
            type: "POST",
            data: $("#add").serialize(),
            success: function (result) {
                alert(result.message);
                window.location.replace("/index.jsp");

            }
        });
    });

</script>

</body>
</html>
